// 当各个组件调用相同业务功能时,可以抽取共同模块出来
import {mapGetters, mapMutations, mapActions} from 'vuex'
export const getImgPath = {
  methods: {
    //传递过来的图片地址需要处理后才能正常使用
    //image_url: "435a7eda7659bac613e524ca7c1ae12epng"
   //转换后/4/35/a7eda7659bac613e524ca7c1ae12epng.png
    getImgPath(path){
      let suffix;
      if(!path){
        return 'http://test.fe.ptdev.cn/elm/elmlogo.jpeg'
      }
      if(path.indexOf('jpeg')!==-1){
        suffix = '.jpeg'
      }else{
        suffix= '.png'
      }
      let url = '/' + path.substr(0, 1) + '/' + path.substr(1, 2) + '/' + path.substr(3) + suffix;
      return 'https://fuss10.elemecdn.com' + url
    }

  }

}
